1. Field of the Invention
The present invention relates to a communication system, and specifically relates to a communication system for controlling a motor of a machine tool.
2. Description of Related Art
Systems in which a many units transmit a small amount of data to each other at short intervals, such as communication systems for controlling a motor of a machine tool, have such a problem that a header, a footer, and the like form a high proportion of a communication packet relative to transmission data, and cause an increase in overhead. Therefore, a method in which a plurality of units share header information for data transmission has been proposed to improve communication efficiency (for example, Japanese Unexamined Patent Publication (Kokai) No. H9-114776, hereinafter referred to as “patent document 1”). However, patent document 1 does not describe a method for sharing an error-correcting code among the plurality of units. Thus, an error-correcting code is required to be added to transmission data of each individual unit. Since the lengths of burst errors occurring in transmission lines are increasing with an increase in the speed of communication, it is expected in the future that an error-correcting code for communication data is accordingly required to be long. Therefore, in order to prevent an increase in the communication overhead, a method for sharing an error-correcting code among the plurality of units is necessary.
When an error-correcting code is simply shared among a plurality of units, a delay due to the recalculation of the error-correcting code becomes a problem. When a unit adds its own data to a received packet and transmits a transmission packet, the unit has to have completed an error correction for the received packet before calculating an error-correcting code for the transmission packet. Thus, the error-correcting code is necessarily transmitted after the reception of the entire received packet, thus causing the occurrence of a delay. Since industrial machines such as machine tools place importance on communication responsivity, such a delay is desirably minimized as much as possible.
Next, the reason why, in the conventional art, a delay occurs in recalculation of an error-correcting code will be described. FIG. 1 shows an example of a conventional technique in which a plurality of units share header information of a packet. In this example, a second unit 1002 merges its own data DATA2 with a packet P3 received from a third unit 1003 into one packet P2, and transmits the packet P2 to a first unit 1001. At this time, the second unit 1002 transmits a header, the transmission data DATA2, an error-correcting code ECC2 for the transmission data DATA2, and then DATA3 and an error-correcting code ECC3 received from the third unit 1003 as is. The DATA3 and the ECC3 are not required to be buffered in the second unit 1002, and are transmitted as they are received. Thus, no delay occurs when the second unit 1002 passes the packet P3. However, in this method, each unit adds an error-correcting code for its own data on an individual basis, thus increasing communication overhead.
On the contrary, when a plurality of units share an error-correcting code in a simple manner, a delay occurs owing to recalculation of the error-correcting code. In FIG. 1, consider a case in which the second unit 1002 calculates an error-correcting code based on the entirety of the DATA2 and the DATA3. In this case, the second unit 1002 becomes able to calculate an error-correcting code based on the entirety of the DATA2 and the DATA3, only after the second unit 1002 has completely received both of the DATA3 and the ECC3. Thus, after the reception of the DATA3 and the ECC3, the second unit 1002 becomes able to start transmitting the error-correcting code. Therefore, as compared with the method of adding an error-correcting code on an individual basis, as described above, a delay is increased by time for the packet P3 to pass the second unit 1002.
Against this backdrop, in a communication system in which a plurality of units use a common packet in data transmission, an error-correcting code is required to be recalculated with high efficiency, when data is added to the packet.
To recalculate an error-correcting code with high efficiency at the time of a data update, a method in which a linear code is used as the error-correcting code, and an error-correcting code for updated data is calculated and added to an original error-correcting code is known (for example, Japanese Unexamined Patent Publication (Kokai) No. 2013-50836). This method allows an update of an error-correcting code for an update of data that is representable by simple addition. However, this method cannot deal with an update of data requiring a data shift. In other words, when data is added to a packet, an update may require a data shift in the packet, so the above method cannot be applied as is.